import Vue from 'vue'
import Router from 'vue-router'

import SingleLayout from '../layout/single-layout'

Vue.use(Router)

const routes = [
  {
    path: '/',
    component: SingleLayout,
    children: [
      {
        path: '/',
        component: () => import('../page/track.vue')
      }
    ]
  },
  {
    path: '/mobile/warehouse_appointment',
    component: () => import('@/page/mobile/warehouse_appointment.vue')
  }
]

let RouterInstance = new Router({
  base: '/',
  mode: 'history',
  routes: routes
})

Vue.prototype.$jump = function (path, param) {
  RouterInstance.push({
    path: path,
    query: param
  })
}

Vue.prototype.$jumpBack = function () {
  window.history.go(-1)
}

export default RouterInstance
